<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <script src="../vue.js"></script>
    <style>
        .v-enter,
        .v-leave-to{
            opacity:0;
        }
        .v-enter-active,
        .v-leave-active{
            transition:opacity 1s;
        }
    </style>
</head>
<body>
<div id="app">
    <!--动画标签-->
    <transition>
        <div v-show="show">hello world</div>
    </transition>
    <button @click="handleClick">切换</button>
</div>

<script>
    var vm = new Vue({
        el: "#app",
        data: {
            show:true
        },
        methods:{
            handleClick: function () {
                this.show=!this.show
            }
        }
    })
</script>
</body>
</html>